import sys
from PyQt4 import QtGui, QtCore
from box import *
from window import *
from questionMark_solver import *
from enum_classes import *
    

def interprete(string = None):

   Bdict = {}
   Bdict["main_window"] = Box(Coordinates(0,0,800,600), BoxType.WINDOW, [], [], {}, {}, {"text":"DSL Tester"}, [], None)
   Bdict["main_window"].direction = BoxDirection.HORIZONTAL

   leftMargin = Box(Coordinates(0,0,-1,-1), BoxType.EMPTY,[],[],{},{},{},[], None)
   
   body = Box(Coordinates(0,0,-1,-1), BoxType.EMPTY, [], [], {}, {}, {}, [], None)
   body.direction = BoxDirection.VERTICAL
   
   RightMargin = Box(Coordinates(0,0,-1,-1), BoxType.EMPTY,[],[],{},{},{},[], None)

   Bdict["main_window"].children = [leftMargin, body, RightMargin]
   
   top_margin = Box(Coordinates(0,0,-1,-1), BoxType.EMPTY,[],[],{},{},{},[], None)
   
   header = Box(Coordinates(0,0,-1,30), BoxType.LABEL,[], [], {}, {}, {"text" : "Enter your DSL code here :", "halign" : "left", "valign" : "middle"}, [], None)

   tb_code = Box(Coordinates(0,0,2000,4000), BoxType.TEXTBOX, [],[],{ "text_val" : GuiVariables.TEXT },{}, {}, [], None)

   container2 = Box(Coordinates(0,0,780,500), BoxType.EMPTY, [], [], {}, {}, {}, [], None)
   container2.direction = BoxDirection.HORIZONTAL
   container2.children = [tb_code]

   spacer2 = Box(Coordinates(0,0,-1,-1), BoxType.EMPTY,[],[],{},{},{},[], None)

   bt_run = Box(Coordinates(0,0,200,30), BoxType.BUTTON, [],[],{}, {"run_code" : GuiEvents.CLICK }, {"text" : "run !" }, [], None)

   spacer3 = Box(Coordinates(0,0,-1,-1), BoxType.EMPTY,[],[],{},{},{},[], None)

   container = Box(Coordinates(0,0,-1,-1), BoxType.EMPTY, [], [], {}, {}, {}, [], None)
   container.direction = BoxDirection.HORIZONTAL
   container.children = [bt_run, spacer3]

   buttom_margin = Box(Coordinates(0,0,-1,-1), BoxType.EMPTY,[],[],{},{},{},[], None)

   body.children = [top_margin, header, container2, spacer2, container, buttom_margin]

   return Bdict



 






























